package com.youren.health.controller;

import com.alibaba.dubbo.config.annotation.Reference;
import com.youren.health.constant.MessageConstant;
import com.youren.health.entity.Result;
import com.youren.health.service.MemberService;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.HashMap;
import java.util.Map;


/**
 * @program: health_parent
 * @author: You_ren_a
 * @create: 2020-12-01 11:41
 **/

@RestController
@RequestMapping("/report")
public class ReportController {

    @Reference
    private MemberService memberService;
    
    @GetMapping("/getMemberReport")
    public Result getMemberReport(){
        Map<String, Object> memberByMouth = memberService.getMemberByMouth();
        return new Result(true , MessageConstant.GET_MEMBER_NUMBER_REPORT_SUCCESS,memberByMouth);
    }

    @GetMapping("/getSetmealReport")
    public Result getSetmealReport(){
        Map<String, Object> setmealReport = memberService.getSetmealReport();
        return new Result(true , MessageConstant.GET_SETMEAL_COUNT_REPORT_SUCCESS,setmealReport);
    }

    @GetMapping("/getBusinessReportData")
    public Result getBusinessReportData(){
        Map<String, Object> resultMap = memberService.getBusinessReportData();
        return new Result(true , MessageConstant.GET_BUSINESS_REPORT_SUCCESS,resultMap);
    }

}
